/**
  * Created by yamei on 2017/7/26.
  */
object substring_into_string {
  def main(args: Array[String]): Unit = {
    val name = "wuqiong"
    val age = 52
    val year = 1965.156
    println(s"$name is $age years old, and Birthday is $year")//字符串拼接
    println(s"$name is  year:${age+1}")//值运算
    println(s"$name is 52 years old:${age == 53}") //判断

    println("*****************************")
    case class student(name:String,age:Int)
    val st = new student("wuqiong",52)
    println(s"${st.name} years old ${st.age}")
    println(f"$name is $age years old, and Birthday is $year%.2f") //这里的 %.2f 意思是取小数点开始的两位 采用四舍五入
    println(f"$name is $age years old, and Birthday is $year%.1f")
    println("*****************************")
    println("%s is %d years old , and Birthday is %s".format(name,age,year)) //这里%s（表示string类型） %d（dicmail int 类型） 是占位符   值是format(name,age) 可以重复使用

  }

}
